package com.supkong.singleton;

import com.alibaba.fastjson.JSON;

/**
 * @author Kong
 * @date 2018/12/14
 * describe:
 */
public class SingletonTest {
    public static void main(String[] args) {
        Car car = Car.getInstance();
        Good good1 =  new Good("苹果",1);
        Good good2 =  new Good("香蕉",2);
        car.add(1,good1);
        car.add(2,good2);

        System.out.println(JSON.toJSONString(car.goodCarMap));
        Good good3 =  new Good("香蕉",2);
        car.del(2,good3);
        System.out.println(JSON.toJSONString(car.goodCarMap));
    }
}
